home *** CD-ROM | disk | FTP | other *** search
/ Satanic Rites 4 / Satanic Rites - Issue 4 (1993-05-29)(Destiny).adf / DIY_cart < prev    next >
Text File  |  1990-01-05  |  6KB  |  151 lines

  1. }0a000
  2.    {g                              --- --------
  3.      {f                            DIY Hardware
  4.        {g                          --- --------
  5.  
  6. {cContributers:
  7.   {a      Terminator / Destiny - Coding
  8.         Narc / Destiny       - Hardware
  9.  
  10.  
  11.   This  article  will  detail  how  anyone with knowledge of 68000 assembly and
  12.  electronics  could  go  about  constructing a device similiar to Datels Action
  13.  Replay.   Although  there  will  be some differences between our cartridge for
  14.  various  reasons  such  as costs, simplicity e.t.c.  Any reference to WE below
  15.  refers to Narc and myself (Terminator)
  16.  
  17.  
  18.                            {d-= {fHARDWARE DESIGN {d=-{a
  19.  
  20.  
  21.  Okay. There are two ways you could go about this.
  22.  
  23. {c 1.{a You have the software in an Eprom.
  24.     Disadvantages: Costs. You need an Eprom programmer for a start...
  25.  
  26. {c 2.{a You have 128k of RAM on the board.
  27.     Disadvantages: You have to upload your software into the board every
  28.                    time you turn on the Amiga.
  29.  
  30.  We  will  be  using  the second method.  It isn't really a disadvantage anyway
  31.  because  then,  you will be able to update your cartridge program easily.  and
  32.  also,  you  could  in  theory, dump commercial cartridges to disk, then upload
  33.  them into your CART-RAM.
  34.  
  35.  The next problem is finding a way of activating the cartridge.
  36.  
  37. {c 1.{a The Expansion bus has a pin called BEER which when pulled low, causes a
  38.     bus error exception.
  39.     If we repoint the bus error vector at $8.w to the first address of our
  40.     cartidrige ram, when we pull this low, we wil be thrown into the
  41.     cartridge. (Upon exit, dont forget we have to fix the bus error stuff
  42.     thats been dumped onto the stack)
  43.     This method is lousy coz we have to repoint the BUS ERROR VECTOR
  44.     which is lame and If a program changes it back, then we won't enter the
  45.     cartridge! Bad news :-(
  46.  
  47. {c 2.{a The Expansion bus also contains 3 pins which you use Binary style to
  48.     tell the amiga which interupt to cause when the cartridge is activated.
  49.     In this case, a level 7 (NMI - Non maskable interupt) is best because
  50.     basically, this interupt is Unstoppable.
  51.     So we pull all three lines low. (1+2+4 = 7)
  52.  
  53. {c 3.{a Upon reset, the computer jumps to F00002.
  54.     Look at the reset routine in ROM. You will notice that it checks if
  55.     {fF00000 {ais a copy of Rom, if not, it jumps to 2(a5) where a5 points to
  56. {f    F00000.{a
  57.     Well, why not use an Address decoder in the cartridge to map our RAM to
  58. {f    F00000.{a Then, the ROM will not copy there. And on reset we jump into the
  59.     cartridge.
  60.     But isn't resetting a lousy way of entering the monitor?
  61.     Ok, Well connect a switch to pull the RESET line low.
  62.     (This causes an external reset but does the same thing as the 3key reset
  63.      - I think :-)
  64.  
  65. {c 4.{a Software interrupts.
  66.     This method is pretty pointless considering the fact that a mojority of
  67.     programs you wanna enter (games,demos e.t.c.) will kill multitasking and
  68.     that goes for a mojority of interupts.
  69.     Note however, that a lot of demos dont kill the level 6 interupt.
  70.     There's an entry point!
  71.  
  72. {a So there we have four methods of entering the cartridge.
  73.  We decided to choose option 3 because basically, it is unstoppable.
  74.  And don't tell me otherwise because the 3 key reset is Hardwired to reset.
  75.  (Maybe not on Wb2.0 - I hear the Keyboard.device accepts the
  76.   installResetHandler which did nothing on V1.3 - True?)
  77.  
  78.  
  79.   {d                         -= {fSOFTWARE DESIGN {d=-{a
  80.  
  81.  Okay, a few points have to be remembered.
  82.  
  83. {e 1. {aYour code must be relocatable. Make it PC relative.
  84. {e 2. {aNo Absolute addressing
  85. {e 3. {aDon't use intuition screens! Use a custom screen.
  86. {e 4. {aTry not if possible to use any library routines other than Exec & Dos
  87. {e 5. {aOn entry, Store the current system status, Restore cartridge variables
  88.     {ato defaults.
  89. {e 6. {aOn exit, Restore system status.
  90.  
  91. {a Those were the basics.
  92.  
  93. {e The  clever  amongst  you will have been wondering where we set up our screen?
  94.  Because basically, the bitplane pointers only work when pointing into ChipRAM
  95.  
  96. {a That  is  also  why action replay and other such devices use a 1 plane screen.
  97.  (to cut down on memory use)
  98.  
  99. {a This is what we do on entry to the cartridge.
  100.  
  101. {f 1> {eTake an area of memory (256*40) from $1000.w
  102. {f 2> {eSwap it with a chunk (256*40) of cartridge memory.
  103. {f 3> {eWe then address or screen memory at $1000.w{a
  104.  
  105.  On  exit,  we  swap  the  1000.w with our cartridge memory again.  There is no
  106.  other way of doing this.  (Even AR3 does it)
  107.  
  108.  The  larger  your screen and the more planes it has, the more chipram you have
  109.  to  overwrite.   Therefore, a 1 plane lowres screen would be best but it looks
  110.  shit so we chose a 1 plane medres screen!
  111.  
  112.                              {d-= {fCONNECTORS {d=-{a
  113.  
  114.  The 86 pin edge connectors for the A500 expansion port, are quite difficult to
  115.  obtain.   I asked Commodore for a supplier and they gave me the following fone
  116.  number :-
  117.  
  118. {e                          CPC Inc. - 0772 555034
  119.  
  120. {a They  are  {gCommodore's {a official spares company so if they don't have any, you
  121.  can't  get  them!   If you are stuck and can't get the proper connectors, then
  122.  there are two ways you could go about MAKING SOME!
  123.  
  124. {c 1) {aGet a 96 pin connector and cut it down to size.
  125.     it looks like this ...
  126.  
  127. {f  ::::::::::::::::::::::::::::::::: :::::::::::::::
  128.  
  129. {a  That's right it has a gap! And that gap makes the connector size shorter
  130.   than 86 pins. Damn! Don't Worry! It will still fit and all the pins we use
  131.   will still be accessable!
  132.   It just won't look so good! :-(
  133.  
  134. {c 2) {aGet two 40 something connectors and cut them so they have 43 pins on
  135.     each and then glue them together!
  136.     It is a good idea to put some sort of solid material on thge top and
  137.     bottom like this ...
  138.  
  139.   {g               ------------- {a  <- Solid stuff
  140. {f  ::::::::::::::::::::::::::::::::::::::::::: {a < 2 connectors glued together in middle
  141.     {g             -------------   {a<- Solid stuff
  142.  
  143.  
  144.  
  145. {a Well,  That's  all  I'm  going  to  say for this month.  This article will be
  146.  continued only if I get some feedback from {dYOU{a!
  147.  
  148. {a I  don't wanna be writing articles which no-one is going to read!  If you like
  149.  this article and want it to appear regularly, let us know!
  150.  
  151.   {f                         Thanks! - Terminator